// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    this.checkLogin();
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
 // 模拟登录，保存固定用户ID和Token
 wx.setStorageSync('token', 'fake_token_for_user_1');
 wx.setStorageSync('userId', 1);
    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  checkLogin: function () {
    // 实现登录检查逻辑
    console.log('进行登录检查');
  },
  globalData: {
    userInfo: null,
    buycar_num: 0,
    totalMoney: 0
  }
})
